<div style="width: 100%; margin-top: 20px; margin-bottom: 10px;">
    <a style="display: block; float: left; padding: 10px; border: 1px solid; margin-right: 10px; background-color: #B1B0B0;" href="<?= Yii::app()->controller->createUrl('/admin/users');?>">Пользователи</a>
    <a style="display: block; float: left; padding: 10px; border: 1px solid; margin-right: 10px; background-color: #B1B0B0;" href="<?= Yii::app()->controller->createUrl('/admin/users/pending_list');?>">Заявки на регистрацию</a>
    <a style="display: block; float: left; padding: 10px; border: 1px solid; margin-right: 10px;" href="<?= Yii::app()->controller->createUrl('/admin/users/approved_list');?>">Зарегистрированные пользователи</a>
    <a style="display: block; float: left; padding: 10px; border: 1px solid; margin-right: 10px; background-color: #B1B0B0;" href="<?= Yii::app()->controller->createUrl('/admin/users/metals');?>">Пользователи раздела Мерные слитки</a>
    <a style="display: block; float: left; padding: 10px; border: 1px solid; margin-right: 10px; background-color: #B1B0B0;" href="<?= Yii::app()->controller->createUrl('/admin/users/rejected_list');?>">Отклоненные пользователи</a>
    <div style="clear: both;"></div>
</div>

<?php if ( Yii::app()->user->hasFlash('user_change_status_success') ) : ?>
<br />
<div class="success">
    <?= Yii::app()->user->getFlash('user_change_status_success'); ?>
</div>
<br />
<?php endif; ?>

<?php if ( Yii::app()->user->hasFlash('user_reset_password_success') ) : ?>
<br />
<div class="success">
    <?= Yii::app()->user->getFlash('user_reset_password_success'); ?>
</div>
<br />
<?php endif; ?>
<div id="users-requests">
<?php

    $this->widget('zii.widgets.grid.CGridView', array
    (
	'enableSorting' => false,
        'dataProvider' => $oDataProvider,
        'columns'      => array
        (
            array
            (
                'name' => 'user_login',
                'htmlOptions' => array('class' => 'center'),
                'value' => '$data->user_login'
            ),
            array
            (
                'name' => 'profile.email',
                'htmlOptions' => array('class' => 'center'),
                'value' => '$data->profile->email'
            ),
            array
            (
                'name' => 'profile.legal_name',
                'htmlOptions' => array('class' => 'center'),
                'value' => '$data->profile->legal_name'
            ),
            array
            (
                'name' => 'user_cdate',
                'htmlOptions' => array('class' => 'center'),
                'value' => 'date("d-m-Y H:i", $data->user_cdate)'
            ),
            array
            (
                'type'        => 'raw',
                'htmlOptions' => array('class' => 'center'),
                'value'       => 'CHtml::link("просмотр", array("/admin/users/details", "user_id" => $data->user_id))'
            ),
            array
            (
                'type'        => 'raw',
                'htmlOptions' => array('class' => 'center'),
                'value'       => '($data->status == "active"?"<p>Активен</p>":"<p>Отключен</p>").
                                  CHtml::beginForm(array("/admin/users/approved_list"), "post").
                                  CHtml::hiddenField("user_id", $data->user_id).
                                  CHtml::hiddenField("do", "change_status").
                                  CHtml::submitButton(($data->status == "active"?"отключить":"активировать")).
                                  CHtml::endForm();'
            ),
            array
            (
                'type'        => 'raw',
                'htmlOptions' => array('class' => 'center'),
                'value'       => 'CHtml::beginForm(array("/admin/users/approved_list"), "post").
                                  CHtml::hiddenField("user_id", $data->user_id).
                                  CHtml::hiddenField("do", "reset_password").
                                  CHtml::submitButton("сбросить пароль").
                                  CHtml::endForm();'
            )
        ),
        'cssFile' => false,
        'pager'   => array
        (
            'cssFile' => false,
            'header'  => ''
        ),
        'summaryText'     => '<div class="fl">Показаны {start}-{end} из {count} результатов.</div>'
    ));

?>
</div>